<!DOCTYPE html>
<html lang="en">
<head>
<title>WebView4Delphi: uWVTypeLibrary: Interface ICoreWebView2_19</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="PasDoc 0.16.0-snapshot">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body>
<span id="ICoreWebView2_19"></span><h1 class="cio">Interface ICoreWebView2_19</h1>
<div class="sections">
<div class="one_section"><a class="section" href="#PasDoc-Description">Description</a></div><div class="one_section"><a class="section" href="#PasDoc-Hierarchy">Hierarchy</a></div><div class="one_section">Fields</div><div class="one_section"><a class="section" href="#PasDoc-Methods">Methods</a></div><div class="one_section">Properties</div></div>
<span id="PasDoc-Description"></span><h2 class="unit">Unit</h2>
<p class="unitlink">
<a href="uWVTypeLibrary.html">uWVTypeLibrary</a></p>
<h2 class="declaration">Declaration</h2>
<p class="declaration">
<code>type ICoreWebView2_19 = interface(<a class="normal" href="uWVTypeLibrary.ICoreWebView2_18.html">ICoreWebView2_18</a>)</code></p>
<h2 class="description">Description</h2>
<p>
 This interface is an extension of ICoreWebView2_18 that manages memory usage target level. </p>
<p>


<p>&lt;see href=&quot;<a href="https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2_19">https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2_19</a>&quot;&gt;See the ICoreWebView2_19 article.)</p>
<span id="PasDoc-Hierarchy"></span><h2 class="hierarchy">Hierarchy</h2>
<ul class="hierarchy"><li class="ancestor">IUnknown</li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2.html">ICoreWebView2</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_2.html">ICoreWebView2_2</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_3.html">ICoreWebView2_3</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_4.html">ICoreWebView2_4</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_5.html">ICoreWebView2_5</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_6.html">ICoreWebView2_6</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_7.html">ICoreWebView2_7</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_8.html">ICoreWebView2_8</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_9.html">ICoreWebView2_9</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_10.html">ICoreWebView2_10</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_11.html">ICoreWebView2_11</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_12.html">ICoreWebView2_12</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_13.html">ICoreWebView2_13</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_14.html">ICoreWebView2_14</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_15.html">ICoreWebView2_15</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_16.html">ICoreWebView2_16</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_17.html">ICoreWebView2_17</a></li>
<li class="ancestor"><a class="normal" href="uWVTypeLibrary.ICoreWebView2_18.html">ICoreWebView2_18</a></li>
<li class="thisitem">ICoreWebView2_19</li></ul><h2 class="overview">Overview</h2>
<span id="PasDoc-Methods"></span><h3 class="summary">Methods</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2_19.html#Get_MemoryUsageTargetLevel-COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL-">Get_MemoryUsageTargetLevel</a></strong>(out level: <a href="uWVTypeLibrary.html#COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL">COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL</a>): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2_19.html#Set_MemoryUsageTargetLevel-COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL-">Set_MemoryUsageTargetLevel</a></strong>(level: <a href="uWVTypeLibrary.html#COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL">COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL</a>): HResult; stdcall;</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Methods</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Get_MemoryUsageTargetLevel-COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL-"></span><code>function <strong>Get_MemoryUsageTargetLevel</strong>(out level: <a href="uWVTypeLibrary.html#COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL">COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL</a>): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 `MemoryUsageTargetLevel` indicates desired memory consumption level of WebView. </p>
<h6 class="description_section">Attributes</h6>
<dl class="attributes">
  <dt>GUID['{6921F954-79B0-437F-A997-C85811897C68}']</dt>
  <dd></dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Set_MemoryUsageTargetLevel-COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL-"></span><code>function <strong>Set_MemoryUsageTargetLevel</strong>(level: <a href="uWVTypeLibrary.html#COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL">COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL</a>): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 An app may set `MemoryUsageTargetLevel` to indicate desired memory consumption level of WebView. Scripts will not be impacted and continue to run. This is useful for inactive apps that still want to run scripts and/or keep network connections alive and therefore could not call `TrySuspend` and `Resume` to reduce memory consumption. These apps can set memory usage target level to `COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL_LOW` when the app becomes inactive, and set back to `COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL_NORMAL` when the app becomes active. It is not necessary to set CoreWebView2Controller's IsVisible property to false when setting the property. It is a best effort operation to change memory usage level, and the API will return before the operation completes. Setting the level to `COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL_LOW` could potentially cause memory for some WebView browser processes to be swapped out to disk in some circumstances. It is a best effort to reduce memory usage as much as possible. If a script runs after its related memory has been swapped out, the memory will be swapped back in to ensure the script can still run, but performance might be impacted. Therefore, the app should set the level back to `COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL_NORMAL` when the app becomes active again. Setting memory usage target level back to normal will not happen automatically. An app should choose to use either the combination of `TrySuspend` and `Resume` or the combination of setting MemoryUsageTargetLevel to low and normal. It is not advisable to mix them. Trying to set `MemoryUsageTargetLevel` while suspended will be ignored. The `TrySuspend` and `Resume` methods will change the `MemoryUsageTargetLevel`. `TrySuspend` will automatically set `MemoryUsageTargetLevel` to low while `Resume` on suspended WebView will automatically set `MemoryUsageTargetLevel` to normal. Calling `Resume` when the WebView is not suspended would not change `MemoryUsageTargetLevel`.

<p>\snippet ViewComponent.cpp MemoryUsageTargetLevel </p>
</td></tr>
</table>
<hr><span class="appinfo"><em>Generated by <a href="https://pasdoc.github.io/">PasDoc 0.16.0-snapshot</a>. </em>
</span>
</body></html>
